﻿@using NetCoreCMS.Models;
@using NetCoreCMS.Common;
@{
    Layout = "~/Areas/admin/Views/Shared/_LayoutEdit.cshtml";
    ViewBag.Title = "编辑类别";
    List<SelectListItem> parentList = ViewData["selectListItems"] as List<SelectListItem>;
    Shop_category m = ViewData["model"] as Shop_category;
}
@section HeaderContent{
    <script src="~/editor/ueditor.config.js"></script>
    <script src="~/editor/ueditor.all.min.js"></script>
    <script src="~/editor/lang/zh-cn/zh-cn.js"></script>
    <script>
      $(function () {
         //初始化表单验证
         $("#form1").initValidform();
         //初始化上传控件
         $(".upload-img").InitUploader({ sendurl: "/upload_ajax/index", swf: "/scripts/webuploader/uploader.swf" });
         //初始化编辑器
         var ue = UE.getEditor('txtContent', {
            serverUrl: '/upload_ajax/index',
            toolbars: [[
                'fullscreen', 'source', '|', 'undo', 'redo', '|',
                'bold', 'italic', 'underline', 'removeformat', 'pasteplain', '|', 'forecolor', 'fontsize', 'insertorderedlist', 'insertunorderedlist', '|',
                'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|',
                'link', 'unlink', '|',
                'simpleupload', 'insertimage', 'scrawl', 'insertvideo', 'attachment'
            ]]
         });
      });

      //删除附件节点
      function delNode(obj) {
         $(obj).parent().remove();
      }
    </script>
}
<form id="form1" method="post" action="SubmitSave?action=@ViewBag.Action&id=@ViewBag.Id">
    <!--导航栏-->
    <div class="location">
        <a href="../shopcate_list/index" class="back"><i class="iconfont icon-up"></i><span>返回列表页</span></a>
        <a href="../center/index"><i class="iconfont icon-home"></i><span>首页</span></a>
        <i class="arrow iconfont icon-arrow-right"></i>
        <a href="../shopcate_list/index"><span>商铺类别</span></a>
        <i class="arrow iconfont icon-arrow-right"></i>
        <span>编辑分类</span>
        <div class="clipboard">
            <span><label id="clipMess"></label></span>
            <a href="javascript:;" class="copy" onclick="copy();"><i class="iconfont icon-copy"></i><span>复制</span></a>
            <a href="javascript:;" class="paste disable" onclick="paste();"><i class="iconfont icon-log"></i><span>粘贴</span></a>
        </div>
    </div>
    <div class="line10"></div>
    <!--/导航栏-->
    <!--内容-->
    <div id="floatHead" class="content-tab-wrap">
        <div class="content-tab">
            <div class="content-tab-ul-wrap">
                <ul>
                    <li><a class="selected" href="javascript:;">基本信息</a></li>
                    <li><a href="javascript:;">扩展选项</a></li>
                </ul>
            </div>
        </div>
    </div>

    <div class="tab-content">
        <dl>
            <dt>所属父类别</dt>
            <dd>
                <div class="rule-single-select">
                    @Html.DropDownList("ddlParentId", new SelectList(parentList, "Value", "Text", m.parent_id))
                </div>
            </dd>
        </dl>
        <dl>
            <dt>排序数字</dt>
            <dd>
                @Html.TextBox("txtSortId", m.sort_id, new { @class = "input small", datatype = "n", sucmsg = " " })
                <span class="Validform_checktip">*数字，越小越向前</span>
            </dd>
        </dl>
        <dl>
            <dt>类别名称</dt>
            <dd>
                @Html.TextBox("txtTitle", m.title, new { @class = "input normal", datatype = "*1-100", sucmsg = " " })
                <span class="Validform_checktip">*类别中文名称，100字符内</span>
            </dd>
        </dl>
        <dl>
            <dt>SEO标题</dt>
            <dd>
                @Html.TextBox("txtSeoTitle", m.seo_title, new { @class = "input normal", datatype = "s0-100", sucmsg = " " })
                <span class="Validform_checktip">255个字符以内</span>
            </dd>
        </dl>
        <dl>
            <dt>SEO关健字</dt>
            <dd>
                @Html.TextArea("txtSeoKeywords", m.seo_description, new { @class = "input" })
                <span class="Validform_checktip">以“,”逗号区分开，255个字符以内</span>
            </dd>
        </dl>
        <dl>
            <dt>SEO描述</dt>
            <dd>
                @Html.TextArea("txtSeoDescription", m.seo_description, new { @class = "input" })
                <span class="Validform_checktip">255个字符以内</span>
            </dd>
        </dl>
    </div>

    <div class="tab-content" style="display:none">
        <dl>
            <dt>URL链接</dt>
            <dd>
                @Html.TextBox("txtLinkUrl", m.link_url, new { @class = "input normal", maxlength = "255" })
                <span class="Validform_checktip">填写后直接跳转到该网址</span>
            </dd>
        </dl>
        <dl>
            <dt>显示图片</dt>
            <dd>
                @Html.TextBox("txtImgUrl", m.img_url, new { @class = "input normal upload-path" })
                <div class="upload-box upload-img"></div>
            </dd>
        </dl>
        <dl>
            <dt>类别介绍</dt>
            <dd>
                @Html.TextArea("txtContent", m.content, new { @class = "editor" })
            </dd>
        </dl>
    </div>
    <!--/内容-->
    <!--工具栏-->
    <div class="page-footer">
        <div class="btn-wrap">
            <input type="submit" id="btnSubmit" class="btn" value="提交保存" />
            <input name="btnReturn" type="button" value="返回上一页" class="btn yellow" onclick="javascript:history.back(-1);" />
        </div>
    </div>
    <!--/工具栏-->

</form>
